﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AgileLogistics.Model
{
  public  class Poll
    {
        public Poll()
        {


        }
        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:False
        /// </summary>  
        /// 
        [SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string Name { get; set; }



        public DateTime StartDate
        {
            get;set;
        }
        public DateTime EndDate
        {
            get; set;
        }

        public bool IsPublic { get; set; }


       

        public  int FangwenCount { get; set; }  
        public string Remark { get; set; }

        [SqlSugar.SugarColumn(IsIgnore =true)]
        public List<PollItem> PollItems 
        { 
            get
            {
                DBContext dBContext = new DBContext();
                return dBContext.DB.Queryable<Model.PollItem>().Where(i => i.PollId == this.Id).ToList();
            }
        }
    }
}
